import request from '@utils/request';
import { service } from '@utils/service'

export async function getAllDatabaseList() {
  return request(`${service.SERVICE_ROOT}/database/allList`);
}

export async function getDatabaseList(params:any) {
  return request(`${service.SERVICE_ROOT}/database/list`,{
    method: 'POST',
    data: {
      ...params,
    },
  } );
}

export async function detailDatabase(params:any) {
  return request(`${service.SERVICE_ROOT}/database/detail`,{
    method: 'POST',
    data: {
      ...params,
    },
  })
}

export async function updateDatabase(params:any) {
  return request(`${service.SERVICE_ROOT}/database/update`,{
    method: 'PUT',
    data: {
      ...params,
    },
  })
}

export async function deleteDatabase(params:any) {
  return request(`${service.SERVICE_ROOT}/database/delete`,{
    method: 'DELETE',
    data: {
      ...params,
    },
  })
}

export async function addDatabase(params:any) {
  return request(`${service.SERVICE_ROOT}/database/add`,{
    method: 'POST',
    data: {
      ...params,
    },
  })
}
